feat: optional taskName parameter to switchWhenOrElse, forEach, and o…#1362
feat: optional taskName parameter to switchWhenOrElse, forEach, and o…#1362matheusandre1 wants to merge 1 commit intoserverlessworkflow:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses #1355 by adding optional taskName-first overloads to FuncDSL control-flow helpers so callers can give explicit, descriptive names to generated switch/for-loop tasks (improving readability and .then("...") navigation) while preserving backward compatibility.
Changes:
- Added
taskName-first overloads forswitchWhen,switchWhenOrElse(predicate + JQ variants),forEach, andforEachItem, with existing overloads delegating to the new ones. - Threaded the provided
taskNamethrough to the underlyingFuncTaskItemListBuildermethods (switchCase(...),forEach(...)) so naming behavior is consistent with other DSL tasks. - Added a comprehensive new JUnit test suite covering named/unnamed behavior and backwards compatibility for the updated control-flow APIs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncDSL.java |
Introduces taskName-first overloads for switch/forEach control-flow helpers and delegates legacy overloads to them. |
experimental/fluent/func/src/test/java/io/serverlessworkflow/fluent/func/FuncDSLTaskNameTest.java |
Adds test coverage validating explicit naming, auto-naming, and backward compatibility across the new overloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
In the ForExecutor block, there's a bug in the test that caused a race condition in the CI. I added local variables and redefined them in each lambda of the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ther control flow methods Signed-off-by: Matheus André <matheusandr2@gmail.com>
…ther control flow methods
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it: Closes: #1355
Special notes for reviewers:
Additional information (if needed):
I thought it was relevant to add a FuncDSLTaskNameTest test layer.